#include <iostream>
using namespace std;
const int maxn = 4e4;
int n, len = 1;
int ans[maxn];

/**
 * 高精度阶乘
 */
int main() {
    cin >> n;
    ans[0] = 1;
    for (int i = 2; i <= n; i++) {
        for (int j = 0; j < len; j++) {
            ans[j] *= i;
        }
        for (int j = 0; j < len; j++) {
            ans[j + 1] += ans[j] / 10;
            ans[j] %= 10;
        }
        while (ans[len]) {
            ans[len + 1] += ans[len] / 10;
            ans[len++] %= 10;
        }
    }
    for (int i = len - 1; i >= 0; --i) {
        cout << ans[i];
    }
    return 0;
}